package train48days;

import java.util.Scanner;

public class 收件人列表 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        while (sc.hasNext()){
            int n = sc.nextInt();
            sc.nextLine();
            StringBuilder sb =new StringBuilder();
            for (int i = 0; i < n; i++) {
                String name = sc.nextLine();
                if (i==n-1) {
                    if (name.contains(",") || name.contains(" ")) {
                        sb.append("\"" + name + "\"");
                    } else {
                        sb.append(name);
                    }
                }else {
                    if (name.contains(",") || name.contains(" ")) {
                        sb.append("\"" + name + "\""+", ");
                    } else {
                        sb.append(name + ", ");
                    }
                }
            }
            System.out.println(sb);
        }
    }
}
